package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.EmpPaperContractAddDTO;
import org.jsola.hr.dto.EmpPaperContractUpdateDTO;
import org.jsola.hr.query.EmpPaperContractQuery;
import org.jsola.hr.vo.EmpPaperContractExcelVO;
import org.jsola.hr.vo.EmpPaperContractListVO;
import org.jsola.hr.vo.EmpPaperContractVO;
import org.jsola.hr.vo.HrPaperContractCountVO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 纸质合同
 *
 * @author zhr
 */
@Api(tags = "hr-纸质合同")
public interface IEmpPaperContractControllerAPI {

    /**
     * 新增纸质合同
     * @param empPaperContractAddDTO 纸质合同新增实体
     * @return 纸质合同展示对象
     */
    @ApiOperation(value = "新增纸质合同")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractAddDTO", dataType = "EmpPaperContractAddDTO", value = "新增纸质合同", paramType = "body")
    })
    Result<EmpPaperContractVO> save(EmpPaperContractAddDTO empPaperContractAddDTO);


    /**
     * 修改纸质合同
     * @param empPaperContractUpdateDTO 纸质合同
     * @return 更新数量
     */
    @ApiOperation(value = "修改纸质合同")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractUpdateDTO", dataType = "EmpPaperContractUpdateDTO", value = "修改纸质合同", paramType = "body")
    })
    Result<Integer> update(EmpPaperContractUpdateDTO empPaperContractUpdateDTO);




    /**
     * 删除单个纸质合同，彻底删除
     * @param empPaperContractId 纸质合同id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个纸质合同，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractId", dataType = "String", value = "纸质合同id", paramType = "path")
    })
    Result<Integer> delete(String empPaperContractId);


    /**
     * 批量删除纸质合同，彻底删除
     * @param empPaperContractIds 纸质合同id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除纸质合同，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractIds", dataType = "String[]", value = "纸质合同id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] empPaperContractIds);


    /**
     * 根据纸质合同id查询纸质合同详情
     * @param empPaperContractId 纸质合同id
     * @return 纸质合同详情
     */
    @ApiOperation(value="根据纸质合同id查询纸质合同详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractId", dataType = "String", value = "纸质合同id", paramType = "path")
    })
    Result<EmpPaperContractVO> findById(String empPaperContractId);


    /**
     * 查询纸质合同
     * @param empPaperContractQuery 纸质合同查询参数
     * @return page
     */
    @ApiOperation(value="查询纸质合同")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractQuery", dataType = "EmpPaperContractQuery", value = "纸质合同查询参数", paramType = "query")
    })
    Result<List<EmpPaperContractListVO>> listAll(EmpPaperContractQuery empPaperContractQuery);


     /**
     * 分页查询纸质合同
     * @param empPaperContractQuery 纸质合同查询参数
     * @return page
     */
    @ApiOperation(value="分页查询纸质合同")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractQuery", dataType = "EmpPaperContractQuery", value = "纸质合同查询参数", paramType = "query")
    })
    Result<Page<EmpPaperContractListVO>> page(EmpPaperContractQuery empPaperContractQuery);

    /**
     * 分页查询纸质合同(可以根据emp的相关信息搜索)
     *
     * @param empPaperContractQuery 查询条件
     * @return 纸质合同列表信息
     */
    @ApiOperation(value="分页查询纸质合同(可以根据emp的相关信息搜索)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractQuery", dataType = "EmpPaperContractQuery", value = "纸质合同查询参数", paramType = "query")
    })
    Result<Page<EmpPaperContractListVO>> selectPageByEmpInfo(EmpPaperContractQuery empPaperContractQuery);

    /**
     * 分页查询纸质合同(可以根据emp的相关信息搜索， POST请求)
     *
     * @param empPaperContractQuery 查询条件
     * @return 纸质合同列表信息
     */
    @ApiOperation(value="分页查询纸质合同(可以根据emp的相关信息搜索， POST请求)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empPaperContractQuery", dataType = "EmpPaperContractQuery", value = "纸质合同查询参数", paramType = "query")
    })
    Result<Page<EmpPaperContractListVO>> selectPageByEmpInfoPost(EmpPaperContractQuery empPaperContractQuery);




    /**
     * 导入excel
     *
     * @param file 上传的文件
     * @return 导入成功数量
     */
    @ApiOperation(value = "导入excel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "文件，Content-Type需要设置为multipart/form-data", paramType = "form"),
            @ApiImplicitParam(name = "companyId", dataType = "AppendixQuery", value = "公司Id", paramType = "path"),
    })
    Result<EmpPaperContractExcelVO> importFile(MultipartFile file, String companyId);

    /**
     * 统计纸质合同各种类型的数量(用工单位级使用，用工单位id必传)
     * @param companyId 用工单位id
     * @return 各种类型的数量
     */
    @ApiOperation(value="统计纸质合同各种类型的数量(用工单位级使用，用工单位id必传)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "用工单位id", paramType = "path")
    })
    Result<HrPaperContractCountVO> statisticsCountByCompanyId(String companyId);

    /**
     * 导出纸质合同列表
     *
     * @param empPaperContractQuery 查询参数
     * @return 合同列表
     */
    @ApiOperation(value = "导出纸质合同列表")
    @ApiImplicitParam(name = "empPaperContractQuery", dataType = "EmpPaperContractQuery", value = "导出查询参数", paramType = "body")
    ResponseEntity<Resource> exportPaperContract(EmpPaperContractQuery empPaperContractQuery);

}

